package net.magicalcloud.magicalcloud.adapter;


import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.ViewGroup;


import net.magicalcloud.magicalcloud.view.viewImpl.fragment.CloudFragment;
import net.magicalcloud.magicalcloud.view.viewImpl.fragment.PersonalFragment;
import net.magicalcloud.magicalcloud.view.viewImpl.fragment.ShareFragment;

import java.util.ArrayList;
import java.util.List;

/**
 *
 */
public class TabbarViewPageAdapter extends FragmentPagerAdapter {

    private List<Fragment> fragments = new ArrayList<>();
   // private Fragment currentFragment;

    public TabbarViewPageAdapter(FragmentManager fm) {
        super(fm);
        fragments.clear();
        fragments.add(new CloudFragment());
        fragments.add(new ShareFragment());
        fragments.add(new PersonalFragment());
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

}
